package com.zh.service.Impl;

import com.zh.bean.Student;
import com.zh.dao.StudentDao;
import com.zh.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


import java.util.List;

@Service("service")
//<bean id="service" class="com.zh.service.Impl.StudentServiceImpl">
public class StudentServiceImpl implements StudentService {
//    <property name="studentDao" ref="studentDao" />
    @Autowired
    private StudentDao studentDao;

//    public void setStudentDao(StudentDao studentDao) {
//        this.studentDao = studentDao;
//    }

    public List<Student> findAll() {
        return studentDao.findAll();
    }

    public Student findById(Integer id) {
        return studentDao.findById(id);
    }

    public int insert(Student stu) {
        return studentDao.insert(stu);
    }

    public int update(Student stu) {
        return studentDao.update(stu);
    }

    public int delete(Integer id) {
        return studentDao.delete(id);
    }

}
